package com.xzy.controller.e;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author xzy
 * @date 2021/11/1610:27
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 配置拦截器
        registry.addInterceptor(new TestInterceptor())
                // 需要拦截的路径
                .addPathPatterns("/test_e/*")
                // 直接放行的路径
                .excludePathPatterns("*/ignore/*");
    }
}
